// pages/Game/componeet/contents.js
// import { weBtoa, weAtob } from '../lib/weapp-jwt'
Component({
  // options: {
  //   dynamicSlots: true, // 启用动态 slot
  // },
    /**
   * 组件的初始数据
   */
  data: {
    active:false,
    leftBgc:'linear-gradient(270deg,#ffedd0,#dff3ff 70%,#bde1ff)',
    colorArr:[
      '255,0,0',
      '255,128,0',
      '255,255,0',
      '0,255,0',
      '0,255,255',
      '0,0,255',
      '128,0,255',
      '255, 192, 203',
      '0,0,0',
      '255,255,255',
    ]
  },
  /**
   * 组件的属性列表
   */
  // attached(){
  //   const star = this.getBase64Url(
  //   '<polygon class="star-polygon" points="100,0 160,180 10,60 190,60 40,180" fill:red;stroke:red;stroke-width:1;></polygon>',200,200
  //   )
  //   this.setData({
  //     star
  //   })
  // },
  methods:{
    getColor(e){
      /**
       * e.currentTarget.dataset.color
       */
      this.triggerEvent('Color',e.currentTarget.dataset.color)
    },
    leftTap(e){
      if((e.currentTarget.dataset.color??'')!==''){
        this.setData({
          active:true
        })
        this.getColor(e)
      }else{
        this.setData({
          active:false
        })
      }
    },
  },
  properties: {

  },



  /**
   * 组件的方法列表
   */
})
